<template>
  <a-drawer 
    v-model:visible="vdata.visible" 
    :maskClosable="false"
    :body-style="{ paddingBottom: '80px' }" 
    width="40%"
    class="drawer-width" 
    @close="onClose"
  >
    <template #title>
      <div style="display:flex;justify-content:space-between;align-items:center;">
        <span>微信代金券</span>
        <a-button>保存草稿</a-button>
      </div>
    </template>

    <a-steps progress-dot :current="vdata.currentStep">
      <a-step title="基础规则" />
      <a-step title="其他规则" />
    </a-steps>

    <a-form
      v-if="vdata.currentStep == 0"
      ref="stepForm0Ref"
      :model="vdata.saveObject"
      layout="horizontal"
      labelAlign="left"
      :hideRequiredMark="true"
      :colon="false"
      :label-col="{ span: 3 }"
      :wrapper-col="{ span: 20 }"
      :rules="vdata.step0Rules"
      style="margin-top: 30px; margin-left: 20px;"
    >
      <a-form-item label="券名称" name="couponName" :wrapper-col="{ span: 9 }">
        <a-input v-model:value="vdata.saveObject['couponName']" placeholder="9个字以内" />
        <a-popover class="tag" placement="right">
          <template #content>
            <a-image :width="200" src="https://jdyd-jhzf-public.oss-cn-hangzhou.aliyuncs.com/oem/non-random.png" />
            <div style="width: 200px;">
              注：<br>
              1. 当用户只享受一个优惠时，微信支付“收银台”（如上图）会展示该活动的名称。除此之外，用户在支付完成页、微信支付凭证、交易记录中也可见活动名称及优惠金额。<br>
              2. 当用户使用付款码支付时，看不到微信支付“收银台”页面。
            </div>
          </template>
          <template #title>
            <span>活动名称曝光示意图</span>
          </template>
          <question-circle-outlined />
        </a-popover>
      </a-form-item>
      <a-form-item label="减价金额" name="reduceMoney">
        <a-input-number v-model:value="vdata.saveObject['reduceMoney']" style="width: 25%;" min="0" />
        <span class="margin-left">元</span>
      </a-form-item>
      <a-form-item label="使用门槛" name="useDoor">
        <a-input-number v-model:value="vdata.saveObject['useDoor']" style="width: 25%;" min="0.01" />
        <span class="margin-left">元</span>
      </a-form-item>
      <a-form-item name="actTime" label="活动有效期" :wrapper-col="{ span: 9 }">
        <a-range-picker
          v-model:value="vdata.saveObject['actTime']"
          value-format="YYYY-MM-DD"
          :disabled-date="(current)=>current && current < dayjs().endOf('day')"
        />
        <a-popover class="tag" placement="right">
          <template #content>
            <div style="width: 200px;">
              开始日期同活动配置<br/>
              结束日期同活动配置
            </div>
          </template>
          <question-circle-outlined />
        </a-popover>
      </a-form-item>
      

      <a-form-item name="actTimeType" label=" " style="margin-top: -15px;" :class="{'mb0':vdata.saveObject.actTimeType == 2 || vdata.saveObject.actTimeType == 3}">
        <a-radio-group v-model:value="vdata.saveObject['actTimeType']">
          <a-radio class="a-radio" :value="0">有效期内，任意时段可用</a-radio><br>
          <a-radio class="a-radio" :value="1">
            <a-form-item name="rangeDay" class="mb0">
              有效期内，用户领券后
              <a-input-number
                v-model:value="vdata.saveObject['rangeDay']"
                :controls="false"
                :precision="0"
                :min="0"
                style="width:50px;"
              />
              天内可用
            </a-form-item>
          </a-radio><br>
          <a-radio class="a-radio" :value="2">有效期内，规则日期可用</a-radio><br>
          <a-radio class="a-radio" :value="3">有效期内，不规则日期可用</a-radio>
        </a-radio-group>
      </a-form-item>

      <a-form-item label=" " v-if="vdata.saveObject['actTimeType'] == 2 || vdata.saveObject['actTimeType'] == 3">
        <a-form-item v-if="vdata.saveObject['actTimeType'] == 2" name="rangeWeek" class="mb0">
          <a-checkbox-group v-model:value="vdata.saveObject['rangeWeek']" :options="weekOptions" />
        </a-form-item>
        <div v-if="vdata.saveObject['actTimeType'] == 3" class="remark">可在有效期内任意选择时间天数，以及可用时段。<br/>因当前微信方系统支持问题，如选择不规则时间，卡包内当前仅会展示有效期，<br/>建议将具体可用日期以及时间段填写在代金券使用说明内。<br/>可用日期和可用时间段的设置是分开进行的，无法指定多个不同的不规则的时间段和日期</div>

        <a-form-item v-if="vdata.saveObject['actTimeType'] == 3" name="rangeDate">
          <div v-for="(item, index) in vdata.saveObject['rangeDate']" :key="index" style="margin-top: 15px;">
            <a-range-picker
              v-model:value="vdata.saveObject['rangeDate'][index]"
              value-format="YYYY-MM-DD"
              :disabled-date="(current)=>current && current < dayjs().endOf('day')"
              @change="dateChange(item,index)"
            />
            <minus-circle-outlined
              v-if="vdata.saveObject['rangeDate'].length == index + 1 && vdata.saveObject['rangeDate'].length != 1"
              style="margin-left: 20px;"
              @click="rangeDateNumReduce()"
            />
            <plus-circle-outlined 
              v-if="vdata.saveObject['rangeDate'].length == index + 1"
              style="margin-left: 15px;"
              @click="rangeDateNumAdd()"
            />
          </div>
        </a-form-item>

        <a-form-item v-if="vdata.saveObject['actTimeType'] == 2 || vdata.saveObject['actTimeType'] == 3" name="rangeTime" class="mb0">
          <div v-for="(item, index) in vdata.saveObject['rangeTime']" :key="index" style="margin-top: 10px;">
            <a-time-range-picker 
              v-model:value="vdata.saveObject['rangeTime'][index]"
              valueFormat="HH:mm"
              format="HH:mm"
              @change="rangeTimeChange(item,index)"
            />
            <minus-circle-outlined
              v-if="vdata.saveObject['rangeTime'].length == index + 1 && vdata.saveObject['rangeTime'].length != 1"
              style="margin-left: 20px;"
              @click="rangeTimeNumReduce()"
            />
            <plus-circle-outlined
              v-if="vdata.saveObject['rangeTime'].length == index + 1 && vdata.saveObject['rangeTime'].length != 3"
              style="margin-left: 15px;"
              @click="rangeTimeNumAdd()"
            />
          </div>
        </a-form-item>
        <p class="remark" style="padding-top:10px;">最多可以存在三个时间段，时间段直接相互不能重叠</p>
      </a-form-item>

      <a-form-item label="使用说明" name="actNotes">
        <a-textarea 
          v-model:value="vdata.saveObject['actNotes']"
          placeholder="活动使用说明，1024个字以内"
          :rows="4" />
      </a-form-item>
    </a-form>


    <a-form
      v-if="vdata.currentStep == 1"
      ref="stepForm1Ref"
      :model="vdata.saveObject"
      layout="horizontal"
      labelAlign="left"
      :hideRequiredMark="true"
      :colon="false"
      :label-col="{ span: 4 }"
      :wrapper-col="{ span: 18 }"
      :rules="vdata.step1Rules"
      style="margin-top: 30px; margin-left: 20px;"
    >
    <a-form-item label="用户可领个数" name="getNum">
        <span>活动期间每个用户可参与</span>
        <a-input-number
          v-model:value="vdata.saveObject['getNum']"
          class="margin-left"
          min="0"
          max="1000"
          :precision="0"
        />
        <span class="margin-left">次</span>
        <a-popover class="margin-left" placement="top">
          <template #content>
            单用户可以享受次数在1-1000之间<br/>同一微信号/同一设备/同一手机号/同一身份证号，满足任意条件均视为同一用户
          </template>
          <question-circle-outlined />
        </a-popover>
      </a-form-item>

      <a-form-item name="isAllowMch" label="可参与商户">
        <a-radio-group v-model:value="vdata.saveObject['isAllowMch']">
          <a-radio class="a-radio" :value="'M0'">本级机构下所有商户</a-radio>
          <a-radio class="a-radio" :value="'M1'">指定商户</a-radio>
        </a-radio-group>
        <div v-if="vdata.saveObject.isAllowMch === 'M1'">
          <div>请选择指定方式</div>
          <a-radio-group v-model:value="vdata.saveObject['selectMchType']">
            <a-radio class="a-radio" :value="'M0'">手动输入商户</a-radio>
            <a-radio class="a-radio" :value="'M1'">手动上传</a-radio>
            <a-radio class="a-radio" :value="'M2'">指定商圈商户</a-radio>
            <a-radio class="a-radio" :value="'M3'">指定标签商户</a-radio>
          </a-radio-group>
        </div>
        
        <a-form-item v-if="vdata.saveObject.isAllowMch === 'M1' && vdata.saveObject.selectMchType === 'M0'" name="mchList" class="mb0">
          <a-textarea
            v-model:value="vdata.saveObject['mchList']"
            placeholder="输入商户号，以回车隔开"
            :rows="4" 
            style="margin-top: 10px;"
          />
        </a-form-item>

        <div v-if="vdata.saveObject.selectMchType === 'M1'">
          <a-button>上传商户名单模板下载</a-button>
          <a-upload v-model:file-list="vdata['fileList']" :action="vdata.action" :headers="vdata.formParams"
            :accept="vdata.accept" :beforeUpload="beforeUpload" :max-count="1" class="margin-left">
            <a-button type="primary">
              <upload-outlined></upload-outlined>
              上传商户名单
            </a-button>
          </a-upload>
        </div>

        <a-form-item v-if="vdata.saveObject.selectMchType === 'M2'" name="mchBusinessList" class="mb0">
          <a-select
            v-model:value="vdata.saveObject['mchBusinessList']"
            mode="multiple"
            label-in-value
            :placeholder="'商圈名称/商圈编号检索'"
            style="width: 100%"
            :filter-option="false"
            :options="merchantArea"
            @search="searchMerchantArea"
          />
        </a-form-item>

        <a-form-item v-if="vdata.saveObject.selectMchType === 'M3'" name="mchTagsList" class="mb0">
          <a-select
            v-model:value="vdata.saveObject['mchTagsList']"
            mode="multiple"
            label-in-value
            :placeholder="'标签名称检索'"
            style="width: 100%"
            :filter-option="false"
            :options="merchantTags"
            @search="searchMerchantArea"
          />
        </a-form-item>
      </a-form-item>
      <a-form-item label="发放数" name="couponNum">
        <a-input-number
          v-model:value="vdata.saveObject['couponNum']"
          min="5"
          :precision="0"
        />
        <span class="margin-left">个</span>
        <a-popover class="margin-left" placement="top">
          <template #content>
            发放数最小为5份
          </template>
          <question-circle-outlined />
        </a-popover>
      </a-form-item>

      <a-form-item label="预算" name="isBudgetMoneyLimit">
        <a-space direction="vertical">
          <strong style="vertical-align: -5px;">{{ (vdata.saveObject.couponNum * vdata.saveObject.reduceMoney) || 0 }} 元</strong>
          <a-radio-group v-model:value="vdata.saveObject['isBudgetMoneyLimit']">
            <a-radio class="a-radio" :value="'M0'">不设置单天预算消耗上限</a-radio>
            <a-radio class="a-radio" :value="'M1'">设置单天预算消耗上限</a-radio>
          </a-radio-group>
          <a-form-item v-if="vdata.saveObject.isBudgetMoneyLimit === 'M1'" name="budgetMoney" class="mb0">
            <a-input-number v-model:value="vdata.saveObject['budgetMoney']" min="0" />
            <span class="margin-left">元</span>
          </a-form-item>
          <div class="remark">非精确控制，单天实际消耗金额可能略有浮动</div>
        </a-space>
      </a-form-item>

      <a-form-item name="isPayTypeLimit" label="支付渠道" class="mb0">
        <a-radio-group v-model:value="vdata.saveObject['isPayTypeLimit']">
          <a-radio class="a-radio" :value="'M0'">不限制</a-radio>
          <a-radio class="a-radio" :value="'M1'">指定银行卡</a-radio>
        </a-radio-group>
      </a-form-item>
      <a-form-item v-if="vdata.saveObject.isPayTypeLimit == 'M1'" name="payType" label=" " class="mb0">
        <a-select
          v-model:value="vdata.saveObject['payType']"
          mode="multiple" placeholder="请添加银行卡类型"
          :options="bankOptions"
          :field-names="{ label: 'name', value: 'id', options: 'children' }"
        />
      </a-form-item>
      <a-form-item v-if="vdata.saveObject.isPayTypeLimit == 'M1'"  label=" ">
        <span>卡BIN限制</span>
        <a-radio-group class="margin-left" v-model:value="vdata.saveObject['isBINTypeLimit']">
          <a-radio class="a-radio" :value="'M0'">不限制</a-radio>
          <a-radio class="a-radio" :value="'M1'">限定卡BIN</a-radio>
        </a-radio-group>
        <a-form-item v-if="vdata.saveObject.isBINTypeLimit === 'M1'" name="bankCardName" class="mb0">
          <a-space style="width:100%;">
            使用<a-input v-model:value="vdata.saveObject['bankCardName']" placeholder="请输入卡片名称，4个中文字符以内" maxlength="4" />借记卡（信用卡）支付可享受优惠
          </a-space>
        </a-form-item>
        <a-form-item v-if="vdata.saveObject.isBINTypeLimit === 'M1'" name="BINType" class="mb0">
          <a-textarea
            v-model:value="vdata.saveObject['BINType']" 
            style="margin: 10px 0;" 
            placeholder="请填写卡BIN，用回车换行，一行一个" 
            :rows="4"
          />
        </a-form-item>
        <div class="remark">卡bin号为银行卡前几位数字，最短6位，最长11位。顾客支付时要同时满足卡类型和卡bin限制要求才能享受优惠。</div>
      </a-form-item>

      <a-form-item name="isUseSameLimit" label="同时使用">
        <a-radio-group v-model:value="vdata.saveObject['isUseSameLimit']" style="padding-top:5px">
          <a-radio class="a-radio" :value="'M0'">该优惠不可以和其他券同时使用（但可以享受满减和随机减）</a-radio><br/>
          <a-radio class="a-radio" :value="'M1'">该优惠可以和其他优惠同时使用（但实际支付金额需要大于等于0.01时才可叠加）</a-radio>
        </a-radio-group>
      </a-form-item>

      <a-form-item name="needPoint" label="兑换所需福分">
        <a-input-number
          v-model:value="vdata.saveObject['needPoint']"
          :precision="0"
          :min="0" />
      </a-form-item>
    </a-form>

    <div class="drawer-btn-center">
      <a-button v-if="vdata.currentStep != 0" style="margin-right:8px" @click="onSteps(-1)">
        <step-backward-outlined />
        上一步
      </a-button>
      <a-button v-if="vdata.currentStep != 1" style="margin-right:8px" @click="onSteps(1)">
        <step-forward-outlined />
        下一步
      </a-button>
      <a-button v-if="vdata.currentStep == 1" type="primary" :loading="vdata.btnLoading"
        @click="handleOkFunc">
        <check-outlined />
        点击提交审核
      </a-button>
    </div>
  </a-drawer>
</template>

<script lang="ts" setup>
import { API_URL_MARKETING_ADD, API_URL_MARKETING_UPDATE, $getMarketingDetails, req } from '@/api/manage'
import { reactive, ref, getCurrentInstance } from 'vue'
import { useUserStore } from '@/store/modules/user'
import dayjs from 'dayjs'
import { checkDateOverlap, checkTimeOverlap, isTimeRangeIncluded, limitNumber } from '@/utils/marketingUtils.js'

const { $infoBox } = getCurrentInstance()!.appContext.config.globalProperties
// 获取当前实例的代理对象
const { proxy }: any = getCurrentInstance()

const emit = defineEmits<{
  (event: 'change'): void
}>()

const vdata: any = reactive({
  btnLoading: false,
  isDetails: false,
  currentStep: 0,
  isAdd: true, // 新增 or 修改页面标志
  saveObject: {}, // 数据对象
  recordId: null, // 更新对象ID
  visible: false, // 是否显示弹层/抽屉
  step0Rules: {
    couponName: [{ required: true, message: '券名称不能为空', trigger: 'blur' }],
    reduceMoney: [{ required: true, message: '减价金额不能为空', trigger: 'blur' }],
    useDoor: [{ required: true, message: '使用门槛不能为空', trigger: 'blur' }],
    actTime: [{ required: true, message: '活动有效期不能为空', trigger: 'blur' }],
    rangeDay: [{ trigger: 'blur', validator: rangeDayValidator }],
    rangeWeek: [{ required: true, message: '请选择周天', trigger: 'change' }],
    rangeDate: [{ trigger: ['blur','change'], validator: rangeDateValidator }],
    rangeTime: [{ trigger: ['blur','change'], validator: rangeTimeValidator }],
    actNotes: [{ required: true, message: '活动说明不能为空', trigger: 'blur' }],
  },
  step1Rules: {
    getNum: [{ required: true, message: '参与次数不能为空', trigger: 'blur' }],
    mchList: [{ required: true, message: '商户号不能为空', trigger: 'blur' }],
    mchBusinessList: [{ required: true, message: '商圈商户不能为空', trigger: ['change','blur'] }],
    mchTagsList: [{ required: true, message: '标签商户不能为空', trigger: ['change','blur'] }],
    couponNum: [{ required: true, message: '发放数不能为空', trigger: 'blur' }],
    budgetMoney: [{ required: true, message: '消耗上限不能为空', trigger: 'blur' }],
    payType: [{ required: true, message: '银行卡类型不能为空', trigger: 'blur' }],
    bankCardName: [{ required: true, message: '卡片名称不能为空', trigger: 'blur' }],
    BINType: [{ required: true, message: '卡BIN不能为空', trigger: 'blur' }],
    needPoint: [{ required: true, message: '福分不能为空', trigger: 'blur' }],
  }
})
// 活动有效期天数限制校验
function rangeDayValidator(){
  return (vdata.saveObject.actTimeType == 1 && !vdata.saveObject.rangeDay) ? Promise.reject('天数不能为空') : Promise.resolve()
}
// 
function rangeDateValidator(){
  const flag = vdata.saveObject.rangeDate.some(item => item != null && item.length > 0)
  return flag ? Promise.resolve() : Promise.reject('可用日期不能为空')
}
// 可用时间段字段校验
function rangeTimeValidator(){
  const flag = vdata.saveObject.rangeTime.some(item => item != null && item.length > 0)
  return flag ? Promise.resolve() : Promise.reject('可用时间段不能为空')
}



// 规则时间选项
const weekOptions = [
  { label: '周一', value: 1 },
  { label: '周二', value: 2 },
  { label: '周三', value: 3 },
  { label: '周四', value: 4 },
  { label: '周五', value: 5 },
  { label: '周六', value: 6 },
  { label: '周日', value: 7 },
]

/**
 * 切换步骤
 */
function onSteps(step: number) {
  console.log(vdata.saveObject)
  if (step < 0) {
    vdata.currentStep--
  } else {
    proxy.$refs['stepForm' + vdata.currentStep + 'Ref'].validate().then(() => {
      vdata.currentStep++
    }).catch(()=>{})
  }
}




function dateChange(currentItem,currentIndex){
  
  if(!vdata.saveObject.rangeDate[currentIndex]){
    return
  }

  if(!vdata.saveObject.actTime){
    vdata.saveObject.rangeDate[currentIndex] = null
    $infoBox.message.warn('请先选择活动有效期！')
    return
  }

  if(!isTimeRangeIncluded(vdata.saveObject.actTime,vdata.saveObject.rangeDate[currentIndex])){  // 判断卡券限制时间是否在活动期内
    vdata.saveObject.rangeDate[currentIndex] = null
    $infoBox.message.warn('限制日期要在活动有效期内！')
    return
  }
  
  if(checkDateOverlap(vdata.saveObject.rangeDate)){
    vdata.saveObject.rangeDate[currentIndex] = null
    $infoBox.message.warn('日期重叠，请重新选择！')
    return
  }
}


function rangeTimeChange(currentItem,currentIndex){ // 判断时间是否存在重叠
  if(checkTimeOverlap(vdata.saveObject.rangeTime)){
    vdata.saveObject.rangeTime[currentIndex] = null
    $infoBox.message.warn('时间重叠，请重新选择！')
  }
}

const bankOptions = ref([
  {
    id: 'jack',
    name: '邮政银行',
    children: [
      {
        id: 'small jack',
        name: '邮政银行--信用卡',
      },
      {
        id: 'small jac2k',
        name: '邮政银行--储蓄卡',
      },
    ],
  },
  {
    id: 'lucy',
    name: '中国银行',
    children: [
      {
        id: 'disabled',
        name: '中国银行--储蓄卡',
      },
      {
        id: 'yiminghe',
        name: '中国银行--信用卡',
      },
    ]
  },

])

// 商圈数据
const merchantArea = ref([
  { lable: 'wd',value: 'wd' },
  { lable: 'yc',value: 'yc' },
  { lable: 'ac',value: 'ac' },
  { lable: 'fj',value: 'fj' },
])

// 标签商户数据
const merchantTags = ref([
  { lable: 'gh',value: 'gh' },
  { lable: 'lm',value: 'lm' },
  { lable: 'uk',value: 'uk' },
])

function searchMerchantArea(){  // 检索商圈
  merchantArea.value = [
    { lable: 'yc',value: 'yc' },
    { lable: 'ac',value: 'ac' },
  ]
}

function beforeUpload(file) {
  // 校验文件大小
  if (file && file.size > vdata.size * 1024 * 1024) {
    var msg = '单张文件请不超过' + vdata.size + 'MB'
    $infoBox.message.error(msg)
    return false
  }
  // 校验文件类型
  let fileFormat = vdata.accept.split(',').map(extension => extension.replace('.', ''));

  if (fileFormat.indexOf(file.name.split('.').pop().toLowerCase()) === -1) {
    var msg = '请上传指定类型文件'
    $infoBox.message.error(msg)
    return false
  }

  $infoBox.message.success('上传成功!')

  // 上传图片
  // return false
  // return $getUploadFormParams(file, 'riskControl').then(res => {
  //   vdata.action = res.formActionUrl // action 
  //   vdata.formParams = res.formParams //表单组件
  //   vdata.fileUrl = res.ossFileUrl  // 文件地址
  //   emit('changeCallback',{url:vdata.fileUrl,uid:file.uid,name:file.name})
  // })
}

function show() { // 弹层打开事件
  // 数据清空
  vdata.currentStep = 0

  vdata.saveObject = {
    actTimeType: 0,  // 活动有效期类型
    rangeWeek: [], // 活动周天
    rangeTime: [[]], //
    rangeDate: [[]], //
    isAllowMch: 'M0',  // 可参与商户限制
    selectMchType: 'M0',
    isBudgetMoneyLimit: 'M0', // 消费上限
    isPayTypeLimit: 'M0', // 支付渠道限制
    isBINTypeLimit: 'M0', // 卡BIN限制
    isUseSameLimit: 'M0', // 同时使用限制
  }
  vdata.btnLoading = false

  vdata.visible = true // 立马展示弹层信息
}

/**
 * 点击【确认】按钮事件      
 */
function handleOkFunc() {
  proxy.$refs['stepForm' + vdata.currentStep + 'Ref'].validate().then(() => {
  }).catch(()=>{})
  console.log(vdata.saveObject)
  return
  vdata.btnLoading = true

  // 请求接口
  var uploadObject: any = {}
  uploadObject.activeType = 5
  uploadObject.createdUid = useUserStore().userInfo.sysUserId
  uploadObject.couponId = vdata.saveObject['couponId']
  uploadObject.examineId = vdata.saveObject['examineId']
  uploadObject.couponName = vdata.saveObject['actName']
  uploadObject.sTime = vdata.saveObject['actTime'][0]
  uploadObject.eTime = vdata.saveObject['actTime'][1]
  uploadObject.couponAmount = vdata.saveObject['reduceMoney'] * vdata.saveObject['numlimit'] * 100
  uploadObject.couponJson = vdata.saveObject

  var url = ''
  if (vdata.isAdd) {
    url = API_URL_MARKETING_ADD
  } else {
    url = API_URL_MARKETING_UPDATE
  }

  req.add(url, uploadObject).then(res => {
    if (vdata.isAdd) {
      $infoBox.message.success('新增成功')
    } else {
      $infoBox.message.success('修改成功')
    }
    vdata.btnLoading = false
    vdata.visible = false
    emit('change')
  }).catch(res => {
    vdata.btnLoading = false
  })

}

function onClose() {
  vdata.visible = false
}

/** 日期范围数增加 */
function rangeDateNumAdd() {
  vdata.saveObject['rangeDate'].push([])
}
/** 日期范围数减少 */
function rangeDateNumReduce() {
  vdata.saveObject['rangeDate'].pop()
}

/** 时间范围数增加 */
function rangeTimeNumAdd() {
  vdata.saveObject['rangeTime'].push([])
}
/** 时间范围数减少 */
function rangeTimeNumReduce() {
  vdata.saveObject['rangeTime'].pop()
}


defineExpose({
  show
})
</script>
<style lang="less" scoped>
.margin-left {
  margin-left: 10px;
}
.mb0{
  margin-bottom: 0;
}

.a-radio {
  line-height: 40px;
}

.tag {
  position: absolute;
  right: -20px;
  top: 8px;
}

.remark {
  color: #999999;
}
:deep(.ant-space .ant-space-item:nth-of-type(2)){
  flex-grow: 1;
}
</style>
